package com.huanbao.oil.app.activity;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.google.gson.Gson;
import com.huanbao.oil.app.R;
import com.huanbao.oil.app.application.MessageEvent;
import com.huanbao.oil.app.commons.Arithmetic4Double;
import com.huanbao.oil.app.commons.JsonUtil;
import com.huanbao.oil.app.commons.UtilsLog;
import com.huanbao.oil.app.model.MainModel;
import com.huanbao.oil.app.model.Model_13_2;
import com.huanbao.oil.app.model.PntTestModel;
import com.huanbao.oil.app.model.SettingModel;
import com.huanbao.oil.app.model.SettingUploadModel;
import com.huanbao.oil.app.model.StatementLeftModel;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;


public class SheZhiCanShuFragment extends Fragment {
    Unbinder unbinder;
    @BindView(R.id.tv_xitong_leiji_yuxing)
    TextView tvXitongLeijiYuxing;
    @BindView(R.id.tv_yaji_leiji_yuxing)
    TextView tvYajiLeijiYuxing;
    @BindView(R.id.tv_shangci_yuxing_shijian)
    TextView tvShangciYuxingShijian;
    @BindView(R.id.tv_chouqiliang)
    TextView tvChouqiliang;
    @BindView(R.id.tv_leiji_chouqiliang)
    TextView tvLeijiChouqiliang;
    @BindView(R.id.tv_qiguan_yali)
    TextView tvQiguanYali;
    @BindView(R.id.tv_jixi_cishu)
    TextView tvJixiCishu;
    @BindView(R.id.tv_xifu_cishu)
    TextView tvXifuCishu;
    @BindView(R.id.tv_xitong_wendu)
    TextView tvXitongWendu;
    @BindView(R.id.tv_yasuoji_yanshi_qidong_shijian)
    EditText tvYasuojiYanshiQidongShijian;
    @BindView(R.id.tv_yasuoji_tingji_baohu_shijian)
    EditText tvYasuojiTingjiBaohuShijian;
    @BindView(R.id.tv_yasuoji_qidong_wendu_21)
    EditText tvYasuojiQidongWendu21;
    @BindView(R.id.tv_yasuoji_qidong_wendu_22)
    EditText tvYasuojiQidongWendu22;
    @BindView(R.id.tv_yasuoji_baohu_wendu_22)
    EditText tvYasuojiBaohuWendu22;
    @BindView(R.id.tv_yasuoji_tingzhi_wendu_22)
    EditText tvYasuojiTingzhiWendu22;
    @BindView(R.id.tv_yasuoji_qidong_wendu_11)
    EditText tvYasuojiQidongWendu11;
    @BindView(R.id.tv_yasuoji_tingzhi_wendu_11)
    EditText tvYasuojiTingzhiWendu11;
    @BindView(R.id.tv_zaixian_jiance_laingcheng_shangxian)
    EditText tvZaixianJianceLaingchengShangxian;
    @BindView(R.id.tv_zaixian_jiance_laingcheng_xiaxian)
    EditText tvZaixianJianceLaingchengXiaxian;
    @BindView(R.id.tv_xitong_weihu_sheding_shichang)
    EditText tvXitongWeihuShedingShichang;
    @BindView(R.id.btn_set)
    TextView btnSet;
    @BindView(R.id.tv_jiexi_shijian)
    EditText tvJiexiShijian;
    @BindView(R.id.tv_xifu_shijian)
    EditText tvXifuShijian;
    @BindView(R.id.tv_rongshuang_shijian)
    EditText tvRongshuangShijian;
    @BindView(R.id.tv_dishui_shijian)
    EditText tvDishuiShijian;
    @BindView(R.id.tv_rongshuang_jiange_shijian)
    EditText tvRongshuangJiangeShijian;
    @BindView(R.id.tv_chuguan_yali_shangxian)
    EditText tvChuguanYaliShangxian;
    @BindView(R.id.tv_chuguan_yali_xiaxian)
    EditText tvChuguanYaliXiaxian;
    @BindView(R.id.tv_youguan_yali_sahngxian)
    EditText tvYouguanYaliSahngxian;
    @BindView(R.id.tv_youguan_yali_xiaxian)
    EditText tvYouguanYaliXiaxian;
    @BindView(R.id.tv_wendu_jiaozheng1)
    EditText tvWenduJiaozheng1;
    @BindView(R.id.tv_wendu_jiaozheng2)
    EditText tvWenduJiaozheng2;
    @BindView(R.id.tv_wendu_jiaozheng3)
    EditText tvWenduJiaozheng3;
    @BindView(R.id.tv_xitong_wendu2)
    TextView tvXitongWendu2;
    @BindView(R.id.tv_rongshuang_wendu_wending_shijian)
    EditText tvRongshuangWenduWendingShijian;
    @BindView(R.id.tv_ban_jiare_shijian)
    EditText tvBanJiareShijian;
    @BindView(R.id.tv_ban_jiare_jiange_shijian)
    EditText tvBanJiareJiangeShijian;
    @BindView(R.id.tv_rongshuang_wendu)
    EditText tvRongshuangWendu;
    private MainActivity mainActivity;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mainActivity = (MainActivity) getActivity();
        EventBus.getDefault().register(this);
        View v = inflater.inflate(R.layout.shezhi_canshu_fragment, null);
        unbinder = ButterKnife.bind(this, v);
        return v;
    }

    @Override
    public void onResume() {
        super.onResume();
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                mainActivity.setSocketData5();
            }
        }, 300);//后执行Runnable中的run方法
        mainActivity.setSocketData7();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
        EventBus.getDefault().unregister(this);
    }

    String jsonStr = "";

    void initData() {
        SettingUploadModel model = new SettingUploadModel();
        model.setCmd_type(11);
        List<SettingModel> pntsModels = new ArrayList<>();
        SettingModel pntsModel = null;
        for (int i = 1; i < 4; i++) {
            pntsModel = new SettingModel();
            pntsModel.setPnt_id(1);
            pntsModel.setPnt_name("DI1");
            pntsModel.setValue_high(2);
            pntsModel.setValue_low(1);
            pntsModels.add(pntsModel);
        }
        model.setPnts(pntsModels);
        Gson gson = new Gson();
        jsonStr = gson.toJson(model);

        new Thread(new Runnable() {
            @Override
            public void run() {
                Message msg = new Message();
                msg.arg1 = 5;
                msg.obj = jsonStr;
                handler.sendMessage(msg);
            }
        }).start();
    }

    List<StatementLeftModel> statementModelList = new ArrayList<>();
    List<MainModel> modelList = new ArrayList<>();
    List<MainModel> modelList_6 = new ArrayList<>();
    String jsonstr = "";
    List<PntTestModel> pntTestModels = new ArrayList<>();

    boolean f_7 = false, f_15 = false;

    @Subscribe(threadMode = ThreadMode.ASYNC, sticky = true)
    public void onMessageEvent(MessageEvent event) {
        if (mainActivity.TCP_MODE == 5) {
            UtilsLog.e("设置参数接收数据===" + event.getMessage());
            if (!TextUtils.isEmpty(event.getMessage()) && !"{}".equals(event.getMessage())
                    && !"{[]}".equals(event.getMessage())) {
                jsonstr = event.getMessage();
                try {
                    JSONObject jsonObject = new JSONObject(event.getMessage());
                    int cmd_type = 0;
                    if (jsonObject.has("cmd_type")) {
                        cmd_type = jsonObject.getInt("cmd_type");
                        UtilsLog.e("参数设置==cmd_type==" + cmd_type);
                    }
//                    if (cmd_type == 44) {
//                        if (jsonObject.getString("pnts") != "[]" && !TextUtils.isEmpty(jsonObject.getString("pnts"))) {
//                            modelList = JsonUtil.stringToArray(jsonObject.getString("pnts"), MainModel[].class);
//                            if (modelList != null && modelList.size() > 0) {
//                                new Thread(new Runnable() {
//                                    @Override
//                                    public void run() {
//                                        Message msg = new Message();
//                                        msg.obj = modelList;
//                                        msg.arg1 = 6;
//                                        handler.sendMessage(msg);
//                                    }
//                                }).start();
//                            } else {
//                                UtilsLog.e("StatementFragment零条数据==");
//                            }
//                        }
//                    } else
                    if (cmd_type == 6) {
                        if (jsonObject.getString("pnts") != "[]" && !TextUtils.isEmpty(jsonObject.getString("pnts"))) {

                            pntTestModels = JsonUtil.stringToArray(jsonObject.getString("pnts"), PntTestModel[].class);
                            if (pntTestModels != null && pntTestModels.size() > 0) {
                                new Thread(new Runnable() {
                                    @Override
                                    public void run() {
                                        Message msg = new Message();
                                        msg.obj = pntTestModels;
                                        msg.arg1 = 6;
                                        handler.sendMessage(msg);
                                    }
                                }).start();
                            } else {
                                UtilsLog.e("StatementFragment零条数据==");
                            }
                        }
                    } else if ((cmd_type == 12)) {
                        new Thread(new Runnable() {
                            @Override
                            public void run() {
                                Message msg = new Message();
                                msg.arg1 = 7;
                                msg.obj = jsonstr;
//                                handler.sendMessage(msg);
                            }
                        }).start();
//                        UtilsLog.e("参数设置==cmd_type!==10");
                    } else if ((cmd_type == 8)) {
                        if (jsonObject.getJSONArray("paras").toString() != null && jsonObject.getJSONArray("paras").toString() != "[]") {
                            new Thread(new Runnable() {
                                @Override
                                public void run() {
                                    Message msg = new Message();
                                    msg.arg1 = 8;
                                    msg.obj = jsonstr;
                                    handler.sendMessage(msg);
                                }
                            }).start();
                        }
                    } else if ((cmd_type == 16)) {
                        String result = jsonObject.getString("result");
                        UtilsLog.e("参数设置==result==" + result);
                        new Thread(new Runnable() {
                            @Override
                            public void run() {
                                Message msg = new Message();
                                msg.arg1 = 16;
                                handler.sendMessage(msg);
                            }
                        }).start();
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                    UtilsLog.e("参数设置==进入解析==" + e.getMessage());
                }
            } else {
                UtilsLog.e("参数设置==没有获取到数据==");
            }
        } else {
            UtilsLog.e("参数设置==00000000==");
        }
    }

    String low_level_value_3 = "0.0", base_vaule_3 = "0.0";
    String high_level_value_4 = "0.0", base_vaule_4 = "0.0";
    String high_level_value_5 = "0.0", low_level_value_5 = "0.0", higher_level_value_5 = "0.0";
    //    String high_level_value_6 = "0.0";
//    String high_level_value_7 = "0.0", low_level_value_7 = "0.0", higher_level_value_7 = "0.0";
    String high_level_value_1 = "0.0", low_level_value_1 = "0.0";
    String high_level_value_2 = "0.0", low_level_value_2 = "0.0";
    String a1 = "0.0", a2 = "0.0", a3 = "0.0", a4 = "0.0", a5 = "0.0", a6 = "0.0",
            a7 = "0.0", a8 = "0.0", a9 = "0.0", a110 = "0.0", a111 = "0.0";
    String jiexi_time = "0.0", xifu_time = "0.0";
    String base_vaule_5 = "0.0", base_vaule_6 = "0.0", base_vaule_7 = "0.0";
    @SuppressLint("HandlerLeak")
    private Handler handler = new Handler() {
        //这是默认的方法
        @Override
        public void handleMessage(Message msg) {

            if (msg.arg1 == 5) {
                if (!TextUtils.isEmpty((String) msg.obj)) {
                    mainActivity.openDoor((String) msg.obj);
                } else {
                    UtilsLog.e("参数设置==msg.obj==");
                }
            } else if (msg.arg1 == 6) {
                List<PntTestModel> pntTestModels = new ArrayList<>();
                pntTestModels = (List<PntTestModel>) msg.obj;
                for (int i = 0; i < pntTestModels.size(); i++) {
                    int pid = pntTestModels.get(i).getPnt_id();
                    if (pid == 3) {
                        if (!TextUtils.isEmpty(pntTestModels.get(i).getBase_vaule())) {
                            if (Integer.valueOf(pntTestModels.get(i).getBase_vaule()) != 0) {
                                base_vaule_3 = pntTestModels.get(i).getBase_vaule();
                            }
                        }
                        if (pntTestModels.get(i).getLow_level_value() != 0) {
                            if (pntTestModels.get(i).getLow_level_value() != 0) {
//                                low_level_value_3 = pntTestModels.get(i).getLow_level_value();
                                low_level_value_3 = String.valueOf(pntTestModels.get(i).getLow_level_value());
                            }
                        }
                    }
                    if (pid == 4) {
                        if (pntTestModels.get(i).getHigh_level_value() != 0) {
                            high_level_value_4 = String.valueOf(pntTestModels.get(i).getHigh_level_value());
                        }
                        if (!TextUtils.isEmpty(pntTestModels.get(i).getBase_vaule())) {
                            if (Integer.valueOf(pntTestModels.get(i).getBase_vaule()) != 0) {
                                base_vaule_4 = pntTestModels.get(i).getBase_vaule();
                            }
                        }
                    }

                    if (pid == 5) {
                        if (pntTestModels.get(i).getHigh_level_value() != 0) {
                            high_level_value_5 = String.valueOf(pntTestModels.get(i).getHigh_level_value());
                        }
                        if (pntTestModels.get(i).getLow_level_value() != 0) {
                            low_level_value_5 = String.valueOf(pntTestModels.get(i).getLow_level_value());
                        }
                        if (pntTestModels.get(i).getHigher_level_value() != 0) {
                            higher_level_value_5 = String.valueOf(pntTestModels.get(i).getHigher_level_value());
                        }
                        if (!TextUtils.isEmpty(pntTestModels.get(i).getBase_vaule())) {
                            if (Integer.valueOf(pntTestModels.get(i).getBase_vaule()) != 0) {
                                base_vaule_5 = pntTestModels.get(i).getBase_vaule();
                            }
                        }

                    }
//                    if (pid == 6) {
//                        if (pntTestModels.get(i).getHigh_level_value() != 0) {
//                            high_level_value_6 = String.valueOf(pntTestModels.get(i).getHigh_level_value());
//                            UtilsLog.e("high_level_value_6=iiiiiiii=" + high_level_value_6 + "=====" + i);
//                        }
//                        if (!TextUtils.isEmpty(pntTestModels.get(i).getBase_vaule())) {
//                            if (Integer.valueOf(pntTestModels.get(i).getBase_vaule()) != 0) {
//                                base_vaule_6 = pntTestModels.get(i).getBase_vaule();
//                            }
//                        }
//                    }
//                    if (pid == 7) {
//                        if (pntTestModels.get(i).getHigh_level_value() != 0) {
//
//                            high_level_value_7 = String.valueOf(pntTestModels.get(i).getHigh_level_value());
//                        }
//                        if (pntTestModels.get(i).getLow_level_value() != 0) {
//
//                            low_level_value_7 = String.valueOf(pntTestModels.get(i).getLow_level_value());
//                        }
//                        if (pntTestModels.get(i).getHigher_level_value() != 0) {
//
//                            higher_level_value_7 = String.valueOf(pntTestModels.get(i).getHigher_level_value());
//                        }
//                        if (!TextUtils.isEmpty(pntTestModels.get(i).getBase_vaule())) {
//
//                            if (Integer.valueOf(pntTestModels.get(i).getBase_vaule()) != 0) {
//
//                                base_vaule_7 = pntTestModels.get(i).getBase_vaule();
//                            }
//                        }
//                    }
                    if (pid == 1) {
                        if (pntTestModels.get(i).getHigh_level_value() != 0) {

                            high_level_value_1 = String.valueOf(pntTestModels.get(i).getHigh_level_value());
                        }
                        if (pntTestModels.get(i).getLow_level_value() != 0) {

                            low_level_value_1 = String.valueOf(pntTestModels.get(i).getLow_level_value());
                        }
                    }
                    if (pid == 2) {
                        if (pntTestModels.get(i).getHigh_level_value() != 0) {
                            high_level_value_2 = String.valueOf(pntTestModels.get(i).getHigh_level_value());

                        }
                        if (pntTestModels.get(i).getLow_level_value() != 0) {

                            low_level_value_2 = String.valueOf(pntTestModels.get(i).getLow_level_value());
                        }
                    }
                }
//
//                tvYasuojiQidongWendu11.setText(Arithmetic4Double.keepOneByStr(high_level_value_5));
//                tvYasuojiTingzhiWendu11.setText(Arithmetic4Double.keepOneByStr(low_level_value_5));

                tvRongshuangWendu.setText(Arithmetic4Double.keepOneByStr(low_level_value_3));

                tvYasuojiQidongWendu21.setText(Arithmetic4Double.keepOneByStr(high_level_value_4));
                tvYasuojiQidongWendu22.setText(Arithmetic4Double.keepOneByStr(high_level_value_5));
                tvYasuojiBaohuWendu22.setText(Arithmetic4Double.keepOneByStr(higher_level_value_5));
                tvYasuojiTingzhiWendu22.setText(Arithmetic4Double.keepOneByStr(low_level_value_5));

                tvChuguanYaliShangxian.setText(Arithmetic4Double.keepOneByStr(high_level_value_1));
                tvChuguanYaliXiaxian.setText(Arithmetic4Double.keepOneByStr(low_level_value_1));

                tvYouguanYaliSahngxian.setText(Arithmetic4Double.keepOneByStr(high_level_value_2));
                tvYouguanYaliXiaxian.setText(Arithmetic4Double.keepOneByStr(low_level_value_2));

                tvWenduJiaozheng1.setText(Arithmetic4Double.keepOneByStr(base_vaule_3));
                tvWenduJiaozheng2.setText(Arithmetic4Double.keepOneByStr(base_vaule_4));
                tvWenduJiaozheng3.setText(Arithmetic4Double.keepOneByStr(base_vaule_5));

                //左侧
                tvXitongLeijiYuxing.setText(Arithmetic4Double.keepOneByStr(String.valueOf(mainActivity.getDataHashMap().get("1000"))));
                tvYajiLeijiYuxing.setText(Arithmetic4Double.keepOneByStr(String.valueOf(mainActivity.getDataHashMap().get("1002"))));
                tvShangciYuxingShijian.setText(Arithmetic4Double.keepOneByStr(String.valueOf(mainActivity.getDataHashMap().get("1003"))));

                String v = mainActivity.getDataHashMap().get("2001");
                if (!TextUtils.isEmpty(v) && "null".equals(v)) {
                    tvChouqiliang.setText(Arithmetic4Double.keepOneByStr(String.valueOf(v)));
                } else {
                    tvChouqiliang.setText("1.0");
                }

                tvLeijiChouqiliang.setText(Arithmetic4Double.keepOneByStr(String.valueOf(mainActivity.getDataHashMap().get("1008"))));
                tvJixiCishu.setText(Arithmetic4Double.keepOneByStr(String.valueOf(mainActivity.getDataHashMap().get("1003"))));
                tvXifuCishu.setText(Arithmetic4Double.keepOneByStr(String.valueOf(mainActivity.getDataHashMap().get("1004"))));
                tvXitongWendu.setText(Arithmetic4Double.keepOneByStr(String.valueOf(mainActivity.getDataHashMap().get("4"))));
                tvXitongWendu2.setText(Arithmetic4Double.keepOneByStr(String.valueOf(mainActivity.getDataHashMap().get("5"))));
                //右侧
//                        tvYasuojiYanshiQidongShijian.setText(String.valueOf(mainActivity.getDataHashMap().get("1001")));
//                        tvYasuojiTingjiBaohuShijian.setText(String.valueOf(mainActivity.getDataHashMap().get("1001")));
//                        tvXitongWeihuShedingShichang.setText(String.valueOf(mainActivity.getDataHashMap().get("1001")));

//                        tvYasuojiQidongWendu21.setText(String.valueOf(mainActivity.getDataHashMap().get("6")));
//                        tvYasuojiQidongWendu22.setText(String.valueOf(mainActivity.getDataHashMap().get("7")));
//                        tvYasuojiBaohuWendu22.setText(String.valueOf(mainActivity.getDataHashMap().get("7")));
//                        tvYasuojiTingzhiWendu22.setText(String.valueOf(mainActivity.getDataHashMap().get("7")));


//                        tvYasuojiQidongWendu11.setText(String.valueOf(mainActivity.getDataHashMap().get("5")));
//                        tvYasuojiTingzhiWendu11.setText(String.valueOf(mainActivity.getDataHashMap().get("5")));

//                jiexi_time = String.valueOf(mainActivity.getDataHashMap().get("30"));
//                xifu_time = String.valueOf(mainActivity.getDataHashMap().get("31"));
//                tvJiexiShijian.setText(Arithmetic4Double.keepOneByStr(jiexi_time));
//                tvXifuShijian.setText(Arithmetic4Double.keepOneByStr(xifu_time));
//
////tttt
//                tvRongshuangShijian.setText("");
//                tvDishuiShijian.setText("");
//                tvRongshuangJiangeShijian.setText("");

//                } else {
//                    UtilsLog.e("参数设置==msg.obj==null");
//                }
            } else if (msg.arg1 == 7) {
                Toast.makeText(mainActivity, "返回：" + msg.obj, Toast.LENGTH_LONG).show();
            } else if (msg.arg1 == 16) {
//                Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_LONG).show();
                f_15 = true;
//                Handler handler = new Handler();
//                handler.postDelayed(new Runnable() {
//                    @Override
//                    public void run() {
//                        mainActivity.setSocketData5();
//                    }
//                }, 300);//后执行Runnable中的run方法
//                mainActivity.setSocketData7();
            } else if (msg.arg1 == 8) {
                try {
                    f_7 = true;
                    UtilsLog.e("参数设置==== 8==" + (String) msg.obj);
                    JSONObject jsonObject = new JSONObject((String) msg.obj);
                    String str = jsonObject.getJSONArray("paras").getJSONObject(0).toString();
                    String str2 = str.replaceAll("Para.", "");
                    String str3 = new JSONObject(str2).getString("YSJDelayStartTime");
                    a1 = Arithmetic4Double.keepOneByStr(str3);
                    tvYasuojiYanshiQidongShijian.setText(Arithmetic4Double.keepOneByStr(str3));

                    String str4 = jsonObject.getJSONArray("paras").getJSONObject(1).toString().replaceAll("Para.", "");
                    String str5 = new JSONObject(str4).getString("YSJDelayStopTime");
                    a2 = Arithmetic4Double.keepOneByStr(str5);
                    tvYasuojiTingjiBaohuShijian.setText(Arithmetic4Double.keepOneByStr(str5));

                    String str41 = jsonObject.getJSONArray("paras").getJSONObject(2).toString().replaceAll("Para.", "");
                    String str51 = new JSONObject(str41).getString("SysMaintainSetTimeHour");
                    a3 = Arithmetic4Double.keepOneByStr(str51);
                    tvXitongWeihuShedingShichang.setText(Arithmetic4Double.keepOneByStr(str51));

                    String str411 = jsonObject.getJSONArray("paras").getJSONObject(3).toString().replaceAll("Para.", "");
                    JSONObject jsonObject1 = new JSONObject(str411);
                    if (jsonObject1.has("RongShuangTime")) {
                        String str511 = new JSONObject(str411).getString("RongShuangTime");
                        a4 = Arithmetic4Double.keepOneByStr(str511);
                        tvRongshuangShijian.setText(Arithmetic4Double.keepOneByStr(str511));
                    } else {
                        UtilsLog.e("没有 RongShuangTime  字段");
                    }

                    String str55 = jsonObject.getJSONArray("paras").getJSONObject(4).toString().replaceAll("Para.", "");
                    String str56 = new JSONObject(str55).getString("DiShuiTime");
                    a5 = Arithmetic4Double.keepOneByStr(str56);
                    tvDishuiShijian.setText(Arithmetic4Double.keepOneByStr(str56));

                    String str61 = jsonObject.getJSONArray("paras").getJSONObject(5).toString().replaceAll("Para.", "");
                    String str62 = new JSONObject(str61).getString("RongShuangJianGeTime");
                    a6 = Arithmetic4Double.keepOneByStr(str62);
                    tvRongshuangJiangeShijian.setText(Arithmetic4Double.keepOneByStr(str62));

                    String str71 = jsonObject.getJSONArray("paras").getJSONObject(6).toString().replaceAll("Para.", "");
                    String str72 = new JSONObject(str71).getString("WorkTime");
                    a7 = Arithmetic4Double.keepOneByStr(str72);
                    tvJiexiShijian.setText(Arithmetic4Double.keepOneByStr(str72));

                    String str81 = jsonObject.getJSONArray("paras").getJSONObject(7).toString().replaceAll("Para.", "");
                    String str82 = new JSONObject(str81).getString("FreeTime");
                    a8 = Arithmetic4Double.keepOneByStr(str82);
                    tvXifuShijian.setText(Arithmetic4Double.keepOneByStr(str82));

                    String str91 = jsonObject.getJSONArray("paras").getJSONObject(7).toString().replaceAll("Para.", "");
                    String str92 = new JSONObject(str91).getString("RongShuangYouXiaoTime");
                    a9 = Arithmetic4Double.keepOneByStr(str92);
                    tvRongshuangWenduWendingShijian.setText(Arithmetic4Double.keepOneByStr(str92));

                    String str101 = jsonObject.getJSONArray("paras").getJSONObject(7).toString().replaceAll("Para.", "");
                    String str102 = new JSONObject(str101).getString("DBRWorkTime");
                    a110 = Arithmetic4Double.keepOneByStr(str102);
                    tvBanJiareShijian.setText(Arithmetic4Double.keepOneByStr(str102));

                    String str111 = jsonObject.getJSONArray("paras").getJSONObject(7).toString().replaceAll("Para.", "");
                    String str112 = new JSONObject(str111).getString("DBRFreeTime");
                    a111 = Arithmetic4Double.keepOneByStr(str112);
                    tvBanJiareJiangeShijian.setText(Arithmetic4Double.keepOneByStr(str112));
                } catch (JSONException e) {
                    e.printStackTrace();
                    UtilsLog.e("参数设置==msg.arg1=JSONException= 8==" + e.getMessage());
                }
            }

            if (f_7 || f_15) {
                Toast.makeText(mainActivity, "设置保存成功", Toast.LENGTH_LONG).show();
                Handler handler = new Handler();
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        mainActivity.setSocketData5();
                    }
                }, 300);//后执行Runnable中的run方法
                mainActivity.setSocketData7();
            }
        }
    };


//    @OnTextChanged(value = R.id.tv_yasuoji_yanshi_qidong_shijian,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange1(Editable editable) {
//        //压缩机延时启动时间
//        String a11 = tvYasuojiYanshiQidongShijian.getText().toString().trim();
//        if (!TextUtils.isEmpty(a11) && IsChange == false) {
//            mainActivity.setSocketData15_1(Double.valueOf(a11));
//        }
//    }

//    @OnTextChanged(value = R.id.tv_yasuoji_tingji_baohu_shijian,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange2(Editable editable) {
//        //压缩机停止保护时间
//        String a21 = tvYasuojiTingjiBaohuShijian.getText().toString().trim();
//        if (!TextUtils.isEmpty(a21) && IsChange == false) {
//            mainActivity.setSocketData15_1(Double.valueOf(a21));
//        }
//    }

//    @OnTextChanged(value = R.id.tv_xitong_weihu_sheding_shichang,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange3(Editable editable) {
//        //系统维护设定时间
//        String a31 = tvXitongWeihuShedingShichang.getText().toString().trim();
//        if (!TextUtils.isEmpty(a31) && IsChange == false) {
//            mainActivity.setSocketData15_1(Double.valueOf(a31));
//        }
//    }

//    @OnTextChanged(value = R.id.tv_yasuoji_qidong_wendu_21,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange4(Editable editable) {
//        //压缩机启动温度21
//        String _6_21 = tvYasuojiQidongWendu21.getText().toString().trim();
//        Model_13_2 modle = new Model_13_2(6, "Temp.Sys2-1", "high_level_value");
//        if (!_6_21.equals(high_level_value_6) && IsChange == false) {
//            mainActivity.str13(modle.getPnt_id(), modle.getPnt_name(), modle.getPara(), _6_21);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_yasuoji_qidong_wendu_22,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange5(Editable editable) {
//        //压缩机启动温度22
//        String _7_22 = tvYasuojiQidongWendu22.getText().toString().trim();
//        Model_13_2 modle2 = new Model_13_2(7, "Temp.Sys2-2", "high_level_value");
//        if (!_7_22.equals(high_level_value_7) && IsChange == false) {
//            mainActivity.str13(modle2.getPnt_id(), modle2.getPnt_name(), modle2.getPara(), _7_22);
//
//        }
//    }

//    @OnTextChanged(value = R.id.tv_yasuoji_baohu_wendu_22,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange6(Editable editable) {
//        //压缩机保护温度22
//        String _7_12 = tvYasuojiBaohuWendu22.getText().toString().trim();
//        Model_13_2 modle3 = new Model_13_2(7, "Temp.Sys2-2", "higher_level_value");
//        if (!_7_12.equals(higher_level_value_7) && IsChange == false) {
//
//            mainActivity.str13(modle3.getPnt_id(), modle3.getPnt_name(), modle3.getPara(), _7_12);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_yasuoji_tingzhi_wendu_22,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange7(Editable editable) {
//        //压缩机停止温度22
//        String _7_122 = tvYasuojiTingzhiWendu22.getText().toString().trim();
//        Model_13_2 modle4 = new Model_13_2(7, "Temp.Sys2-2", "low_level_value");
//        if (!_7_122.equals(low_level_value_7) && IsChange == false) {
//
//            mainActivity.str13(modle4.getPnt_id(), modle4.getPnt_name(), modle4.getPara(), _7_122);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_yasuoji_qidong_wendu_11,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange8(Editable editable) {
//        //压缩机启动温度11
//        String _5_1 = tvYasuojiQidongWendu11.getText().toString().trim();
//        Model_13_2 modle5 = new Model_13_2(5, "Temp.Sys1", "high_level_value");
//        if (!_5_1.equals(high_level_value_5) && IsChange == false) {
//
//            mainActivity.str13(modle5.getPnt_id(), modle5.getPnt_name(), modle5.getPara(), _5_1);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_yasuoji_tingzhi_wendu_11,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange9(Editable editable) {
//        //压缩机停止温度11
//        String _5_2 = tvYasuojiTingzhiWendu11.getText().toString().trim();
//        Model_13_2 modle6 = new Model_13_2(5, "Temp.Sys1", "low_level_value");
//        if (!_5_2.equals(low_level_value_5) && IsChange == false) {
//
//            mainActivity.str13(modle6.getPnt_id(), modle6.getPnt_name(), modle6.getPara(), _5_2);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_jiexi_shijian,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange10(Editable editable) {
//        //解析时间
//        String _30 = tvJiexiShijian.getText().toString().trim();
//        Model_13_2 modle7 = new Model_13_2(30, "IO.XFF_Out", "work_time");
//        if (!_30.equals(jiexi_time) && IsChange == false) {
//
//            mainActivity.str13(modle7.getPnt_id(), modle7.getPnt_name(), modle7.getPara(), _30);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_xifu_shijian,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange11(Editable editable) {
//        //吸附时间
//        String _31 = tvXifuShijian.getText().toString().trim();
//        Model_13_2 modle8 = new Model_13_2(30, "IO.JXF_Out", "free_time");
//        if (!_31.equals(xifu_time) && IsChange == false) {
//
//            mainActivity.str13(modle8.getPnt_id(), modle8.getPnt_name(), modle8.getPara(), _31);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_chuguan_yali_shangxian,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange12(Editable editable) {
//        //储罐压力上限
//        String _1_1 = tvChuguanYaliShangxian.getText().toString().trim();
//        Model_13_2 modle9 = new Model_13_2(1, "Analog.Pressure", "high_level_value");
//        if (!_1_1.equals(high_level_value_1) && IsChange == false) {
//
//            mainActivity.str13(modle9.getPnt_id(), modle9.getPnt_name(), modle9.getPara(), _1_1);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_chuguan_yali_xiaxian,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange13(Editable editable) {
//        //储罐压力下限
//        String _1_2 = tvChuguanYaliXiaxian.getText().toString().trim();
//        Model_13_2 modle10 = new Model_13_2(1, "Analog.Pressure", "low_level_value");
//        if (!_1_2.equals(low_level_value_1) && IsChange == false) {
//
//            mainActivity.str13(modle10.getPnt_id(), modle10.getPnt_name(), modle10.getPara(), _1_2);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_youguan_yali_sahngxian,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange14(Editable editable) {
//        //油罐压力上限
//        String _2_1 = tvYouguanYaliSahngxian.getText().toString().trim();
//        Model_13_2 modle11 = new Model_13_2(2, "Analog.LiquidLevel", "high_level_value");
//        if (!_2_1.equals(high_level_value_2) && IsChange == false) {
//
//            mainActivity.str13(modle11.getPnt_id(), modle11.getPnt_name(), modle11.getPara(), _2_1);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_youguan_yali_xiaxian,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange15(Editable editable) {
//        //油罐压力下限
//        String _2_2 = tvYouguanYaliXiaxian.getText().toString().trim();
//        Model_13_2 modle12 = new Model_13_2(2, "Analog.LiquidLevel", "low_level_value");
//        if (!_2_2.equals(low_level_value_2) && IsChange == false) {
//
//            mainActivity.str13(modle12.getPnt_id(), modle12.getPnt_name(), modle12.getPara(), _2_2);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_wendu_jiaozheng1,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange16(Editable editable) {
//        //温度校正1
//        String _5_5 = tvWenduJiaozheng1.getText().toString().trim();
//        Model_13_2 modle13 = new Model_13_2(5, "Temp.Sys1", "base_vaule");
//        if (IsChange == false) {
//
//            mainActivity.str13(modle13.getPnt_id(), modle13.getPnt_name(), modle13.getPara(), _5_5);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_wendu_jiaozheng2,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange17(Editable editable) {
//        //温度校正2
//        String _5_6 = tvWenduJiaozheng2.getText().toString().trim();
//        Model_13_2 modle14 = new Model_13_2(6, "Temp.Sys2-1", "base_vaule");
//        if (IsChange == false) {
//
//            mainActivity.str13(modle14.getPnt_id(), modle14.getPnt_name(), modle14.getPara(), _5_6);
//        }
//    }

//    @OnTextChanged(value = R.id.tv_wendu_jiaozheng3,
//            callback = AFTER_TEXT_CHANGED)
//    void onAfterTextChange18(Editable editable) {
//        //温度校正3
//        String _5_7 = tvWenduJiaozheng3.getText().toString().trim();
//        Model_13_2 modle15 = new Model_13_2(7, "Temp.Sys2-2", "base_vaule");
//        if (IsChange == false) {
//            mainActivity.str13(modle15.getPnt_id(), modle15.getPnt_name(), modle15.getPara(), _5_7);
//        }
//    }

    @OnClick(R.id.btn_set)
    public void onViewClicked() {
        String jsonBody = "";
        String jsonBody15 = "";
        //温度校正3--系统温度2-2校正
        String _5_7 = tvWenduJiaozheng3.getText().toString().trim();
        Model_13_2 modle15 = new Model_13_2(5, "Temp.YSJ2-2", "base_vaule");
        if (!Arithmetic4Double.keepOneByStr(_5_7).equals(Arithmetic4Double.keepOneByStr(base_vaule_5))) {
            jsonBody += mainActivity.strping(modle15.getPnt_id(), modle15.getPnt_name(), modle15.getPara(), _5_7);
//            mainActivity.str13_wendu_1(modle15.getPnt_id(), modle15.getPnt_name(), modle15.getPara(), _5_7);
            base_vaule_5 = _5_7;
        }

        //温度校正2--系统温度2-1校正
        String _5_6 = tvWenduJiaozheng2.getText().toString().trim();
        Model_13_2 modle14 = new Model_13_2(4, "Temp.YSJ2-1", "base_vaule");
        if (!Arithmetic4Double.keepOneByStr(_5_6).equals(Arithmetic4Double.keepOneByStr(base_vaule_4))) {
//            mainActivity.str13_wendu_2(modle14.getPnt_id(), modle14.getPnt_name(), modle14.getPara(), _5_6);
            jsonBody += mainActivity.strping(modle14.getPnt_id(), modle14.getPnt_name(), modle14.getPara(), _5_6);
            base_vaule_4 = _5_6;
        }

        //温度校正1----1号冷箱温度校正
        String _5_5 = tvWenduJiaozheng1.getText().toString().trim();
        Model_13_2 modle13 = new Model_13_2(3, "Temp.LX1", "base_vaule");
        if (!Arithmetic4Double.keepOneByStr(_5_5).equals(Arithmetic4Double.keepOneByStr(base_vaule_3))) {
//            mainActivity.str_13_wendu_3(modle13.getPnt_id(), modle13.getPnt_name(), modle13.getPara(), _5_5);
            jsonBody += mainActivity.strping(modle13.getPnt_id(), modle13.getPnt_name(), modle13.getPara(), _5_5);
            base_vaule_3 = _5_5;
        }

        //油罐压力下限
        String _2_2 = tvYouguanYaliXiaxian.getText().toString().trim();
        Model_13_2 modle12 = new Model_13_2(2, "Analog.LiquidLevel", "low_level_value");
        if (!Arithmetic4Double.keepOneByStr(_2_2).equals(Arithmetic4Double.keepOneByStr(low_level_value_2))) {
//            mainActivity.str13(modle12.getPnt_id(), modle12.getPnt_name(), modle12.getPara(), _2_2);
            jsonBody += mainActivity.strping(modle12.getPnt_id(), modle12.getPnt_name(), modle12.getPara(), _2_2);
        }

        //油罐压力上限
        String _2_1 = tvYouguanYaliSahngxian.getText().toString().trim();
        Model_13_2 modle11 = new Model_13_2(2, "Analog.LiquidLevel", "high_level_value");

        if (!Arithmetic4Double.keepOneByStr(_2_1).equals(Arithmetic4Double.keepOneByStr(high_level_value_2))) {
//            mainActivity.str13(modle11.getPnt_id(), modle11.getPnt_name(), modle11.getPara(), _2_1);
            jsonBody += mainActivity.strping(modle11.getPnt_id(), modle11.getPnt_name(), modle11.getPara(), _2_1);
        }

        //储罐压力下限
        String _1_2 = tvChuguanYaliXiaxian.getText().toString().trim();
        Model_13_2 modle10 = new Model_13_2(1, "Analog.Pressure", "low_level_value");

        if (!Arithmetic4Double.keepOneByStr(_1_2).equals(Arithmetic4Double.keepOneByStr(low_level_value_1))) {
//            mainActivity.str13(modle10.getPnt_id(), modle10.getPnt_name(), modle10.getPara(), _1_2);
            jsonBody += mainActivity.strping(modle10.getPnt_id(), modle10.getPnt_name(), modle10.getPara(), _1_2);
        }

        //储罐压力上限
        String _1_1 = tvChuguanYaliShangxian.getText().toString().trim();
        Model_13_2 modle9 = new Model_13_2(1, "Analog.Pressure", "high_level_value");
        if (!Arithmetic4Double.keepOneByStr(_1_1).equals(Arithmetic4Double.keepOneByStr(high_level_value_1))) {
//            mainActivity.str13(modle9.getPnt_id(), modle9.getPnt_name(), modle9.getPara(), _1_1);
            jsonBody += mainActivity.strping(modle9.getPnt_id(), modle9.getPnt_name(), modle9.getPara(), _1_1);
        }

//        //压缩机停止温度11
//        String _5_2 = tvYasuojiTingzhiWendu11.getText().toString().trim();
//        Model_13_2 modle6 = new Model_13_2(5, "Temp.Sys1", "low_level_value");
//        if (!_5_2.equals(low_level_value_5)) {
//            mainActivity.str13(modle6.getPnt_id(), modle6.getPnt_name(), modle6.getPara(), _5_2);
//        }
//
//        //压缩机启动温度11
//        String _5_1 = tvYasuojiQidongWendu11.getText().toString().trim();
//        Model_13_2 modle5 = new Model_13_2(5, "Temp.Sys1", "high_level_value");
//        if (!_5_1.equals(high_level_value_5)) {
//            mainActivity.str13(modle5.getPnt_id(), modle5.getPnt_name(), modle5.getPara(), _5_1);
//        }

        //压缩机停止温度22
        String _7_122 = tvYasuojiTingzhiWendu22.getText().toString().trim();
        Model_13_2 modle4 = new Model_13_2(5, "Temp.YSJ2-2", "low_level_value");
        if (!Arithmetic4Double.keepOneByStr(_7_122).equals(Arithmetic4Double.keepOneByStr(low_level_value_5))) {
//            mainActivity.str13(modle4.getPnt_id(), modle4.getPnt_name(), modle4.getPara(), _7_122);
            jsonBody += mainActivity.strping(modle4.getPnt_id(), modle4.getPnt_name(), modle4.getPara(), _7_122);
        }

        //压缩机保护温度22
        String _7_12 = tvYasuojiBaohuWendu22.getText().toString().trim();
        Model_13_2 modle3 = new Model_13_2(5, "Temp.YSJ2-2", "higher_level_value");
        if (!Arithmetic4Double.keepOneByStr(_7_12).equals(Arithmetic4Double.keepOneByStr(higher_level_value_5))) {
//            mainActivity.str13(modle3.getPnt_id(), modle3.getPnt_name(), modle3.getPara(), _7_12);
            jsonBody += mainActivity.strping(modle3.getPnt_id(), modle3.getPnt_name(), modle3.getPara(), _7_12);
        }

        //压缩机启动温度22
        String _7_22 = tvYasuojiQidongWendu22.getText().toString().trim();
        Model_13_2 modle2 = new Model_13_2(5, "Temp.YSJ2-2", "high_level_value");
        if (!Arithmetic4Double.keepOneByStr(_7_22).equals(Arithmetic4Double.keepOneByStr(high_level_value_5))) {
//            mainActivity.str13(modle2.getPnt_id(), modle2.getPnt_name(), modle2.getPara(), _7_22);
            jsonBody += mainActivity.strping(modle2.getPnt_id(), modle2.getPnt_name(), modle2.getPara(), _7_22);
        }

        //压缩机启动温度21
        String _6_21 = tvYasuojiQidongWendu21.getText().toString().trim();
        Model_13_2 modle = new Model_13_2(4, "Temp.YSJ2-1", "high_level_value");
        if (!Arithmetic4Double.keepOneByStr(_6_21).equals(Arithmetic4Double.keepOneByStr(high_level_value_4))) {
//            mainActivity.str13(modle.getPnt_id(), modle.getPnt_name(), modle.getPara(), _6_21);
            jsonBody += mainActivity.strping(modle.getPnt_id(), modle.getPnt_name(), modle.getPara(), _6_21);
        }

        //融霜温度
        String _7_21 = tvRongshuangWendu.getText().toString().trim();
        Model_13_2 modle127 = new Model_13_2(3, "Temp.LX1", "low_level_value");
        if (!Arithmetic4Double.keepOneByStr(_7_21).equals(Arithmetic4Double.keepOneByStr(low_level_value_3))) {
//            mainActivity.str13(modle.getPnt_id(), modle.getPnt_name(), modle.getPara(), _6_21);
            jsonBody += mainActivity.strping(modle127.getPnt_id(), modle127.getPnt_name(), modle127.getPara(), _7_21);
        }


        if (jsonBody != "") {
            UtilsLog.e("jsonBody===" + jsonBody);
            UtilsLog.e("jsonBody===" + jsonBody.substring(0, jsonBody.length() - 1));
            mainActivity.send_strping(jsonBody.substring(0, jsonBody.length() - 1));
        }
        //系统维护设定时间
        String a31 = tvXitongWeihuShedingShichang.getText().toString().trim();
        if (!a3.equals(a31)) {
//            mainActivity.setSocketData15_3(Double.valueOf(a31));
            jsonBody15 += mainActivity.send15json("Para.SysMaintainSetTimeHour", Double.valueOf(a31));
        }

        //压缩机停止保护时间
        String a21 = tvYasuojiTingjiBaohuShijian.getText().toString().trim();

        if (!a2.equals(a21)) {
//            mainActivity.setSocketData15_2(Double.valueOf(a21));
            jsonBody15 += mainActivity.send15json("Para.YSJDelayStopTime", Double.valueOf(a21));
        }
        //压缩机延时启动时间
        String a11 = tvYasuojiYanshiQidongShijian.getText().toString().trim();

        if (!a1.equals(a11)) {
//            mainActivity.setSocketData15_1(Double.valueOf(a11));
            jsonBody15 += mainActivity.send15json("Para.YSJDelayStartTime", Double.valueOf(a11));
        }

        //吸附时间
        String _31 = tvXifuShijian.getText().toString().trim();

        if (!_31.equals(a8)) {
//            mainActivity.setSocketData15_xifu(Double.valueOf(_31));
            jsonBody15 += mainActivity.send15json("Para.FreeTime", Double.valueOf(_31));
        }

        //解析时间
        String _30 = tvJiexiShijian.getText().toString().trim();
        if (!_30.equals(a7)) {
//            mainActivity.setSocketData15_jiexi(Double.valueOf(_30));
            jsonBody15 += mainActivity.send15json("Para.WorkTime", Double.valueOf(_30));
        }
        //容霜时间
        String _51 = tvRongshuangShijian.getText().toString().trim();
        if (!_51.equals(a4)) {
//            mainActivity.setSocketData15_rongshuang_shijian(Double.valueOf(_51));
            jsonBody15 += mainActivity.send15json("Para.RongShuangTime", Double.valueOf(_51));
        }
        //容霜间隔时间
        String _52 = tvRongshuangJiangeShijian.getText().toString().trim();
        if (!_52.equals(a6)) {
//            mainActivity.setSocketData15_rongshuang_jiange(Double.valueOf(_52));
            jsonBody15 += mainActivity.send15json("Para.RongShuangJianGeTime", Double.valueOf(_52));
        }
        //滴水时间
        String _53 = tvDishuiShijian.getText().toString().trim();
        if (!_53.equals(a5)) {
//            mainActivity.setSocketData15_dishui_shijian(Double.valueOf(_53));
            jsonBody15 += mainActivity.send15json("Para.DiShuiTime", Double.valueOf(_53));
        }
        //伴加热时间
        String _54 = tvBanJiareShijian.getText().toString().trim();
        if (!_54.equals(a5)) {
//            mainActivity.setSocketData15_dishui_shijian(Double.valueOf(_53));
            jsonBody15 += mainActivity.send15json("Para.DBRWorkTime", Double.valueOf(_54));
        }
        //伴加热间隔时间
        String _55 = tvBanJiareJiangeShijian.getText().toString().trim();
        if (!_55.equals(a5)) {
//            mainActivity.setSocketData15_dishui_shijian(Double.valueOf(_53));
            jsonBody15 += mainActivity.send15json("Para.DBRFreeTime", Double.valueOf(_55));
        }
        if (jsonBody15 != "") {
            UtilsLog.e("jsonBody15===" + jsonBody15);
            UtilsLog.e("jsonBody15===" + jsonBody15.substring(0, jsonBody15.length() - 1));
            mainActivity.send15(jsonBody15.substring(0, jsonBody15.length() - 1));
        }
    }
}
